package trabajoISW2.presentation.shared;

import trabajoISW2.domain.implementations.Address;
import trabajoISW2.domain.implementations.Cart;
import trabajoISW2.domain.implementations.CreditCard;
import trabajoISW2.domain.implementations.Order;

public class OrderMapper {

	public static OrderDTO createDTO (Order o){

		OrderDTO res= new OrderDTO(o.getOrderId(), CartMapper.createDTO(o.getCart()), o.getCreditCard().getNumber(), AddressMapper.createDTO(o.getAddress()));
		return res;
	}
	


	public static Order createDomainObject(CreditCard cc, Address ad, Cart cart){
		Order res = new Order(cc,cart,ad);

		return res;
	}

}
